﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Easy.Operation;

namespace Easy.Web.Service.Entity
{
    /// <summary>
    /// GetViewAttribute 的摘要说明
    /// </summary>
    public class GetViewAttribute : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string entityId = context.Request["entityId"];

            string procedureName = context.Request["procedureName"];

            List<AttributeMap> List = EntitySetting_Function.GetAttributeListNew(entityId, procedureName);
            string options = "";
            foreach (AttributeMap item in List)
            {
                options += "<option value='" + item.name + "' entity='" + item.EntityName + "' linkentity='" + item.LinkEntityName + "' linkattribute='" + item.LinkAttributeName + "'>" + item.DisplayName + "</option>";

            }
            context.Response.Write(options);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}